package com.sihai.tmall.adminhome.controller;

import com.sihai.tmall.adminhome.service.AdminHomeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class AdminHomeController {
    @Autowired
    private AdminHomeService adminHomeService;
    @GetMapping("OnSaleProductTotal")
    public Long getOnSaleProductTotal(@RequestParam(value = "3") Byte productOrderStatus){
        Long onSaleProductTotal = adminHomeService.onSaleProductTotal(productOrderStatus);
        return onSaleProductTotal;
    }
    @GetMapping("getUserTotal")
    public Long getUserTotal(){
        Long userTotal = adminHomeService.userTotal();
        return userTotal;
    }
    @GetMapping("getProductOrderTotal")
    public Long getProductOrderTotal(Integer productOrderCount){
        Long orderTotal = adminHomeService.productOrderTotal(productOrderCount);
        return orderTotal;
    }

}
